﻿using Lidgren.Network;
using Model.LiveControl;

namespace Network.Messages.LiveControl.C2S
{
    public class C2SResponseControlResultMessge : NovaMessage
    {

        public C2SResponseControlResultMessge() : base((ushort)CustomMessageType.C2SResponseControlResultMessge)
        {
        }

        public ResultType Result;
        public string RefuseReason;

        public override void WritePayload(NetOutgoingMessage message)
        {
            base.WritePayload(message);
            message.Write((int)Result);
            message.Write(RefuseReason);
        }

        public override void ReadPayload(NetIncomingMessage message)
        {
            base.ReadPayload(message);
            Result =(ResultType)message.ReadInt32();
            RefuseReason = message.ReadString();
        }
    }
}
